package service;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Calendar;

import ec.edu.ucacue.siop.contenedor.ContEstadisticas;
import ec.edu.ucacue.siop.service.estadisticas.ControlEstadisticoService;
import ec.edu.ucacue.siop.service.estadisticas.ControlEstadisticoServiceImpl;

public class PruebaBusquedaStadistica {

	public static void main(String[] args) {
		ControlEstadisticoService ces = new ControlEstadisticoServiceImpl();
		String nomVar = "VELOCIDAD VENTILADOR";
		String unidad = "D59";
		Calendar fi = Calendar.getInstance();
		Calendar ff = Calendar.getInstance();
		int year= 2014;
		int month = 0;
		int date = 1;
		int hourOfDay = 0;
		int minute =0;
		fi.set(year, month, date, hourOfDay, minute);
		ff.set(year, month, 28, 23, minute);
		ContEstadisticas cont = ces.estadisticaPorVarProc(nomVar, unidad, fi, ff);
		if(cont  != null) {
			
			System.out.println("Variable " + cont.getNombreVariable() + " Unidad Funcional " + cont.getUnidadFuncional() + 
					"\n max = " + cont.getMax() + "\n min = " + cont.getMin() + "\n Media = " + cont.getMedia() +
					"\n mediana " + cont.getMediana() 
					+ "\n Media Geometrica = " + cont.getMediaGeometrica() + "\n Desviacion Tipica = "  + cont.getDesvTip());
		}
		else {
			System.out.println("no hubo resultados");
			
		}
	}

}
